Socket
Socket
Sign inDemoInstall

minipass-pipeline

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minipass-pipeline

create a pipeline of streams using Minipass


Version published
Weekly downloads
14M
increased by4.31%
Maintainers
1
Weekly downloads
 
Created

What is minipass-pipeline?

The minipass-pipeline package is a Node.js module that allows you to create a pipeline of streams (typically transform streams) that data can be written to. Once written, the data will flow through each stream in the pipeline in order. It is built on the Minipass stream library, which is a small, fast stream implementation.

What are minipass-pipeline's main functionalities?

Stream Pipeline Creation

This feature allows you to create a pipeline of streams. Data written to the pipeline will be processed by each stream in turn. In this example, a file is read, compressed using gzip, and then written to a new file.

{"const Pipeline = require('minipass-pipeline')
const fs = require('fs')
const zlib = require('zlib')

const pipeline = new Pipeline(
  fs.createReadStream('input.txt'),
  zlib.createGzip(),
  fs.createWriteStream('output.txt.gz')
)

pipeline.write('some data')
pipeline.end()"}

Error Handling

This feature allows you to handle errors that may occur in the pipeline. The 'error' event is emitted if any stream in the pipeline emits an 'error' event. In this example, an error handler is attached to the pipeline to log any errors that occur.

{"const Pipeline = require('minipass-pipeline')
const fs = require('fs')
const zlib = require('zlib')

const pipeline = new Pipeline(
  fs.createReadStream('input.txt'),
  zlib.createGzip(),
  fs.createWriteStream('output.txt.gz')
)

pipeline.on('error', (err) => {
  console.error('Pipeline error:', err)
})"}

Other packages similar to minipass-pipeline

FAQs

Package last updated on 28 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc